from playhouse.pool import PooledMySQLDatabase
from playhouse.shortcuts import ReconnectMixin
# mysql gone alway


# 使用peewee链接池
class ReconnectMysqlDatabase(ReconnectMixin,PooledMySQLDatabase):
    pass


MYSQL_DB = "youyan_user_srv"
MYSQL_HOST = "127.0.0.1"
MYSQL_PORT = 31716
MYSQL_USER = "go_demo"
MYSQL_PASSWORD = "WFRgQPSKV?A1zNBE"


DB = ReconnectMysqlDatabase(database=MYSQL_DB, host=MYSQL_HOST, port=MYSQL_PORT, user=MYSQL_USER, password=MYSQL_PASSWORD)